<?php
//前台商城类别控制器
namespace App\Http\Controllers\home;

use Illuminate\Http\Request;

use App\Http\Requests;

class PortController extends CommonController
{ 
    //加载前台网站类别页
	public function index()
    {
		$fname = $_GET['fname'];
		$fid = $_GET['fid'];
		//判断此小板块下是否有类别页
		$k = \DB::table("m_genre")->where("name", $fname)->where("fid",$fid)->first();
		if(empty($k)){
			//没有返回主页
			return redirect('home/index');
		}
		$z = \DB::table("notice")->where('status','0')->get();
		$n = \DB::table("notice")->where('status','1')->get();
		$f = \DB::table("m_forum")->get();
		$t = \DB::table("m_type")->get();
		$g = \DB::table("m_genre")->get();
		$p = \DB::table("m_pag")->get();
		$fl = \DB::table("friendlink")->get();
		$s = \DB::table("m_search")->where("fid",$fid)->get();
		$m = \DB::table("m_info")->where("fid",$fid)->get();
		return view("home.port",['forum'=>$f,'genre'=>$g,'minfo'=>$m, 'notice'=>$n,'notices'=>$z,'friendlink'=>$fl, 'search'=>$s,'type'=>$t,'pag'=>$p, 'port'=>$k]);
    }
	public function show($id)
	{
		return "456";
	}
}
